﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frw;
using log4net;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace Frw.Logging
{
    public class Log4NetLogger : BusinessClassBase<ILogger, Log4NetLogger>, ILogger
    {
        private readonly ILog logger = LogManager.GetLogger("Log4NetLogger");

        public Log4NetLogger()
        {

        }

        public void Log(Exception exception)
        {

        }

        public void Log(LogLevel logLevel, string message)
        {
            switch (logLevel)
            {
                case LogLevel.Debug:
                    logger.Debug(message);
                    break;
                case LogLevel.Error:
                    logger.Error(message);
                    break;
                case LogLevel.Fatal:
                    logger.Fatal(message);
                    break;
                case LogLevel.Info:
                    logger.Info(message);
                    break;
                case LogLevel.Warn:
                    logger.Warn(message);
                    break;
                default:
                    break;
            }
        }
    }
}

